@import "../../styles/index.scss";

$timeline-prefix-cls: "timeline";

$head-base-size: 16px;

@mixin head-content {
  display: inline-block;
  box-sizing: border-box;
  width: $head-base-size;
  border-radius: 50%;
  color: $black-15;
}

.#{$timeline-prefix-cls}-title {
  display: inline-block;
  vertical-align: top;
  color: $black-65;
  padding-right: 16px;
  font-weight: 700;
}

.#{$timeline-prefix-cls}-wrapper {
  .#{$timeline-prefix-cls} {
    display: inline-block;
    list-style: none;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    width: 100%;
    &-item {
      position: relative;
      box-sizing: border-box;
      width: 100%;
      padding-bottom: 40px;
      &-head {
        position: absolute;
        top: 0;
        left: 0;
        z-index: 99;
        width: $head-base-size;
        padding-top: $head-base-size / 4;
        padding-bottom: $head-base-size / 4;
        background-color: #fff;
        box-sizing: border-box;
        &.timeline-item-head-auto {
          &:after {
            content: "";
            border: 4px solid $black-65;
            height: $head-base-size;
            @include head-content();
          }
        }
        &.timeline-item-head-icon {
          text-align: center;
          @include head-content();
        }
      }
      &-title {
        display: flex;
        align-items: center;
        padding-left: 32px;
        font-size: 16px;
        font-weight: 700;
        color: $black-65;
      }
      &-subtitle {
        display: inline-block;
        padding-left: 40px;
        overflow: hidden;
        font-size: 14px;
      }
      &-content {
        padding-left: 32px;
        margin-top: 10px;
        box-sizing: border-box;
        &-row {
          &:not(:last-child) {
            margin-bottom: 10px;
          }
        }
      }
      &-tail {
        position: absolute;
        left: $head-base-size / 2 - 1;
        top: 0;
        z-index: 9;
        height: 100%;
        border-left: 2px solid $black-15;
        box-sizing: border-box;
      }
      &.timeline-item-last {
        padding-bottom: 0;
        .timeline-item-tail {
          display: none;
        }
      }
    }
  }
}
